// viewport unit values for browsers with spotty support:
//   * vmin in IE9
//   * vmax in IE9, iOS <= 6
//   * calc(vh/vmin) in iOS < 8 and Android Stock Browser <= 4.4
//   * all of viewport units in Android Stock Browser <= 4.3
// var hacks = require('viewport-units-buggyfill/viewport-units-buggyfill.hacks')
// require('viewport-units-buggyfill').init({
//   hacks: hacks
// })

Promise.prototype.finally = function(callback) {
  let P = this.constructor
  return this.then(
    value => P.resolve(callback()).then(() => value),
    reason =>
      P.resolve(callback()).then(() => {
        throw reason
      })
  )
}

// ios :active 伪类不触发，需要在元素或者body上监听touchstart事件
document.body.addEventListener('touchstart', function() {
  // do some thing
})
